<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
include_once( BASEPATH . '/helpers/file_helper'.EXT);
/**
 * CodeIgniter
 *
 * An open source application development framework for PHP 4.3.2 or newer
 *
 * @package		CodeIgniter
 * @author		ExpressionEngine Dev Team
 * @copyright	Copyright (c) 2008, EllisLab, Inc.
 * @license		http://codeigniter.com/user_guide/license.html
 * @link		http://codeigniter.com
 * @since		Version 1.0
 * @filesource
 */

// ------------------------------------------------------------------------

/**
 * Custom CodeIgniter File Helpers
 *
 * @package		Exa
 * @subpackage	Helpers
 * @category	Helpers
 * @author		Exa
 * @link		NA
 */

// ------------------------------------------------------------------------		

/**	
 * Check File Exists
 *
 * Lets you check whether file exists or not
 *
 * @access	public
 * @param	string
 * @return  boolean
 */	
if( !function_exists("check_file_exists") )
{
	function check_file_exists($file)
	{	
		if( is_file($file) )
			return 1;
		else
			return 0;
			
	}
	
}

// ------------------------------------------------------------------------  

/** 
 * Check Folder Exists if not then creates one
 *
 * Lets you check whether fodler exists or not
 *
 * @access public
 * @param string
 * @return  boolean
 */ 
if( !function_exists("check_folder_exists") )
{
 function check_folder_exists($folder){ 
  
  if (file_exists($folder)) {  
   return 1;  
  } else {  
   if(mkdir($folder, 0777))
    return 1;
   else
    return 0;
  }  
   
 }
 
}
?>